package com.swan.beans;

public class UserBean {
    private int id;
    private String name;
    private String phone;
    private String role;
    /**
     * User status.
     *
     * @See {@link StatusEnum}
     */
    private String status;

    
    /**
     * 是否选中
     */
    private boolean selected;
    
    public boolean getSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    
    
    
    public UserBean() {
	}

	public UserBean(String name, String phone, String role, String status) {
		this.name = name;
		this.phone = phone;
		this.role = role;
		this.status = status;
	}
    
    
    public int getId() {
        return id;
    }

    public UserBean setId(int id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public UserBean setName(String name) {
        this.name = name;
        return this;
    }

    public String getPhone() {
        return phone;
    }

    public UserBean setPhone(String phone) {
        this.phone = phone;
        return this;
    }

    public String getRole() {
        return role;
    }

    public UserBean setRole(String role) {
        this.role = role;
        return this;
    }

    public UserBean setRole(int role) {
        this.role = RoleEnum.get(role).name();
        return this;
    }

    /**
     * get user status.
     *
     * @See {@link StatusEnum}
     */
    public String getStatus() {
        return status;
    }

    /**
     * set user status.
     *
     * @See {@link StatusEnum}
     */
    public UserBean setStatus(String status) {
        this.status = status;
        return this;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", role='" + role + '\'' +
                ", status='" + status + '\'' +
                '}';
    }
}
